package com.gp.controls;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.util.Log;

import com.baidu.mapapi.GeoPoint;
import com.baidu.mapapi.ItemizedOverlay;
import com.baidu.mapapi.MapView;
import com.baidu.mapapi.OverlayItem;

public class AddOverlay extends ItemizedOverlay<OverlayItem> {
    
    private List<OverlayItem> mGeoList = new ArrayList<OverlayItem>();

    public AddOverlay( Drawable marker, Context context, GeoPoint pt,
            String title ) {
        super(boundCenterBottom(marker));
      

        mGeoList.add(new OverlayItem(pt, title, null));

        populate();
    }

    @Override
    protected OverlayItem createItem(int i) {
        return mGeoList.get(i);
    }

    @Override
    public int size() {
        return mGeoList.size();
    }

    @Override
    public boolean onSnapToItem(int i, int j, Point point, MapView mapview) {
        Log.e("ItemizedOverlayDemo", "enter onSnapToItem()!");
        return false;
    }
}